<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>22.静态继承原理</title>
</head>

<body>

</body>
<script>
  // 使用原型的静态继承
  function User () { }
  User.site = "后盾人";
  User.url = function () {
    return "houdunren.com";
  };
  function Admin () { }
  Admin.__proto__ = User;
  console.dir(Admin);
  console.log(Admin.url());

  // 使用class的静态继承
  class User2 {
    static site = "后盾人";
    static host () {
      return "houdunren.com";
    }
  }
  class Admin2 extends User2 { }
  console.dir(Admin2);
</script>

</html>